<template>
	<view class="border-top">
		<view class="px-2 flex align-center justify-between border-bottom" style="height: 100rpx;" v-for="(item, index) in list" :key="index">
			<view class="font32 color666 font-weight-500">时间：{{item.lastupdate}}</view>
			<view class="font32 color333 font-weight-bold">{{ item.temperature }}℃</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			list: []
		};
	},
	onLoad(options) {
		this.getData(options.id);
	},
	methods: {
		getData(id) {
			let _this = this;
			let opts = {
				url: 'TemperatureList.shtml'
			};
			let param = {
				xsglId: id
			};
			_this.$http.httpRequest(opts, param).then(
				res => {
					console.log(res.data);
					if (res.data.code == '200') {
						_this.list = res.data.data;
					} else {
						uni.showToast({
							icon: 'none',
							title: res.data.msg
						});
					}
				},
				error => {
					console.log(error);
				}
			);
		}
	}
};
</script>

<style></style>
